import request from '@/config/axios'

export interface CraftTaskBillVO {
  id: number
  productNumber: string
  productName: string
  partCode: string
  partName: string
  partSpecification: string
  remark: string
  creatorName: string
  partDrawingNumber: string
  dictTaskStatus: number
}

// 查询配置中心--工艺配置--工艺配置任务单列表
export const getCraftTaskBillPage = async (params) => {
  return await request.get({ url: `/config/craft-task-bill/page`, params })
}

// 查询配置中心--工艺配置--工艺配置任务单详情
export const getCraftTaskBill = async (id: number) => {
  return await request.get({ url: `/config/craft-task-bill/get?id=` + id })
}

// 查询配置中心--工艺配置--工艺配置任务单表单详情
export const getCraftTaskBillList = async (id: number) => {
  return await request.get({ url: `/config/craft-task-bill/list?id=` + id })
}

// 查询配置中心--工艺配置--工艺配置工艺配置单
export const getCraftCoursePage = async (params) => {
  return await request.get({ url: `/config/craft-course/page`, params })
}

// 新增配置中心--工艺配置--工艺配置任务单
export const createCraftTaskBill = async (data: CraftTaskBillVO) => {
  return await request.post({ url: `/config/craft-task-bill/create`, data })
}

// 修改配置中心--工艺配置--工艺配置任务单
export const updateCraftTaskBill = async (data) => {
  return await request.put({ url: `/config/craft-course-conf/update`, data })
}

// 删除配置中心--工艺配置--工艺配置任务单
export const deleteCraftTaskBill = async (id: number) => {
  return await request.delete({ url: `/config/craft-task-bill/delete?id=` + id })
}

// 删除配置中心--工艺配置--编辑移除
export const deleteCraftTaskConf = async (id: number) => {
  return await request.delete({ url: `/config/craft-course-conf/delete?id=` + id })
}

// 导出配置中心--工艺配置--工艺配置任务单 Excel
export const exportCraftTaskBill = async (params) => {
  return await request.download({ url: `/config/craft-task-bill/export-excel`, params })
}

// 配置中心--工艺配置--刷新配置任务单详情
export const getSublist = async (dict: number) => {
  return await request.get({ url: `/config/craft-product-process/list/child?dictProcessName=` + dict })
}

// 配置中心--工艺配置--指导书详情
export const getCraftCourseBook = async (params) => {
  return await request.get({ url: `/config/craft-task-bill-conf-file/page`, params })
}

// 删除配置中心--工艺配置--指导书
export const deleteCraftBillFile = async (id: number) => {
  return await request.delete({ url: `/config/craft-task-bill-conf-file/delete?id=` + id })
}

// 新增配置中心--工艺配置--工艺配置任务单
export const createCraftTaskFile = async (data) => {
  return await request.post({ url: `/config/craft-task-bill-conf-file/create`, data })
}

// 查询配置中心--工艺配置--工艺路线表单详情
export const getCraftCourseList = async (id: number) => {
  return await request.get({ url: `/config/craft-course-conf/list?id=` + id })
}
